use dataset_fort_worth_cross, clear

gen x = pctyesed - pctyesnoned

#delimit;

gr tw
	(sc x pctnhblack [aw=totalvotes], msize(tiny) msym(Oh) col(gray))
	(lpoly x pctnhblack [aw=totalvotes], col(black) lwid(thick))
	,
		yline(0, lpat(dash))
		by(year, legend(off) note("") rows(1)
		 title("(a) (Election Day) - (Early) and Share Black"))
		ylab(, angle(horiz))
		subtitle(, fcol(none) lwid(none))
		plotregion(style(none))
		name(g1, replace)
		ytitle("")
		xtitle("Share Black")
		;
		
#delimit cr

gr close

bys year: cor x pctnhblack [aw=totalvotes] 

#delimit;

gr tw
	(sc x distance[aw=totalvotes], msize(tiny) msym(Oh) col(gray))
	(lpoly x distance [aw=totalvotes], col(black) lwid(thick))
	,
		yline(0, lpat(dash))
		by(year, legend(off) note("") rows(1)
		 title("(b) (Election Day) - (Early) and Proximity to Shooting"))
		ylab(, angle(horiz))
		subtitle(, fcol(none) lwid(none))
		plotregion(style(none))
		xscale(reverse)
		name(g2, replace)
		ytitle("")
		xtitle("Proximity to Shooting")
		;
		
#delimit cr

gr close

bys year: cor x distance [aw=totalvotes] 

gr combine g1 g2, rows(2) l1title("(Election Day) - (Early/Absentee)") ///
	xsize(2) ysize(2)

gr export "_output/figure A16.pdf", replace
